using System;

namespace PhillyCodeCamp.Infrastructure
{
    public static class DependencyResolver
    {
        private static IDependencyResolver RealResolver;

        public static TInterface Resolve<TInterface>()
        {
            try
            {
                return RealResolver.Resolve<TInterface>();
            }
            catch (Exception e)
            {
                throw new InterfaceResolutionException(typeof(TInterface), e);
            }
        }

        public static void InitializeWith(IDependencyResolver realResolver)
        {
            RealResolver = realResolver;
        }


   }
}